package com.hongdee.crm.approval.controller;

import com.hongdee.crm.approval.dao.ITCrmCarApprovalFlowDetailDao;
import com.hongdee.crm.approval.service.ITCrmCarApprovalFlowDetailService;
import com.hongdee.crm.coupon.service.ITCrmCarCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by Mr. Xu on 2017/8/5.
 */
@RestController
@RequestMapping("/crm/crmapprovalDetail")
public class TCrmCarApprovalFlowDetailController {
    @Autowired
    private ITCrmCarApprovalFlowDetailService itCrmCarApprovalFlowDetailService;
    /**
     * 审批明细分页
     * @param uid
     * @param token
     * @param start
     * @param limit
     * @param data
     * @return
     * @throws Exception
     */
    @RequestMapping("/page")
    @ResponseBody
    public Map page(@RequestParam(name = "uid", defaultValue = "") String uid,
                    @RequestParam(name = "token", defaultValue = "") String token,
                    @RequestParam(name = "start", defaultValue = "0") String start,
                    @RequestParam(name = "limit", defaultValue = "50") String limit,
                    @RequestBody Map data) throws Exception {

        Map map = this.itCrmCarApprovalFlowDetailService.approvalPage(data, start, limit, uid);
        map.put("success", true);
        map.put("msg", "分页查询成功！");
        return map;
    }

}
